<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.util.container.more.StackMap</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.util.container.more.StackMap");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791">tango.util.container.more.StackMap</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: April 2008<br><br>
<b>author:</b><br>Kris<br><br>
<b>Since:</b><br>0.99.7<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L40">StackMap</a></span>
<script>explorer.outline.addDecl('StackMap');</script>(K, V, alias Hash = Container.hash, 
                      alias Reap = Container.reap, 
                      alias Heap = Container.Collect);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">StackMap extends the basic hashmap type by adding a limit to 
        the number of items contained at any given time. In addition, 
        StackMap retains the order in which elements were added, and
        employs that during foreach&#40;&#41; traversal. Additions to the map
        beyond the capacity will result in an exception being thrown.</font><br><br>
<font color="black">You can push and pop things just like an typical stack, and/or
        traverse the entries in the order they were added, though with 
        the additional capability of retrieving and/or removing by key.<br><br>        Note also that a push/add operation will replace an existing 
        entry with the same key, exposing a twist on the stack notion.<br><br></font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L65">this</a></span>
<script>explorer.outline.addDecl('this');</script>(uint <span class="funcparam">capacity</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a cache with the specified maximum number of 
                entries. Additions to the cache beyond this number will
                throw an exception</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>~<span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L89">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">clean up when done
                
</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L100">reaper</a></span>
<script>explorer.outline.addDecl('reaper');</script>(K, R)(K <span class="funcparam">k</span>, R <span class="funcparam">r</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Reaping callback for the hashmap, acting as a trampoline</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L110">size</a></span>
<script>explorer.outline.addDecl('size');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L120">clear</a></span>
<script>explorer.outline.addDecl('clear');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L140">push</a></span>
<script>explorer.outline.addDecl('push');</script>(K <span class="funcparam">key</span>, V <span class="funcparam">value</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Place an entry into the cache and associate it with the
                provided key. Note that there can be only one entry for
                any particular key. If two entries are added with the 
                same key, the second effectively overwrites the first.</font><br><br>
<font color="black">Returns true if we added a new entry; false if we just
                replaced an existing one. A replacement does not change
                the order of the keys, and thus does not change stack
                ordering.<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L151">popHead</a></span>
<script>explorer.outline.addDecl('popHead');</script>(ref K <span class="funcparam">key</span>, ref V <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Remove and return the more recent addition to the stack</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L167">popTail</a></span>
<script>explorer.outline.addDecl('popTail');</script>(ref K <span class="funcparam">key</span>, ref V <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Remove and return the oldest addition to the stack</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L183">opApply</a></span>
<script>explorer.outline.addDecl('opApply');</script>(int delegate(ref K key, ref V value) <span class="funcparam">dg</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Iterate from the oldest to the most recent additions</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L215">add</a></span>
<script>explorer.outline.addDecl('add');</script>(K <span class="funcparam">key</span>, V <span class="funcparam">value</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Place an entry into the cache and associate it with the
                provided key. Note that there can be only one entry for
                any particular key. If two entries are added with the 
                same key, the second effectively overwrites the first.</font><br><br>
<font color="black">Returns true if we added a new entry; false if we just
                replaced an existing one. A replacement does not change
                the order of the keys, and thus does not change stack
                ordering.<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L239">get</a></span>
<script>explorer.outline.addDecl('get');</script>(K <span class="funcparam">key</span>, ref V <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Get the cache entry identified by the given key</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L258">take</a></span>
<script>explorer.outline.addDecl('take');</script>(K <span class="funcparam">key</span>, ref V <span class="funcparam">value</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Remove &#40;and return&#41; the cache entry associated with the 
                provided key. Returns false if there is no such entry.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L286">deReference</a></span>
<script>explorer.outline.addDecl('deReference');</script>(Ref <span class="funcparam">entry</span>); [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Place a cache entry at the tail of the queue. This makes
                it the least-recently referenced.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L308">reReference</a></span>
<script>explorer.outline.addDecl('reReference');</script>(Ref <span class="funcparam">entry</span>); [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Move a cache entry to the head of the queue. This makes
                it the most-recently referenced.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L330">addEntry</a></span>
<script>explorer.outline.addDecl('addEntry');</script>(K <span class="funcparam">key</span>, V <span class="funcparam">value</span>); [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Add an entry into the queue. An exception is thrown if 
                the queue is full</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L348">QueuedEntry</a></span>
<script>explorer.outline.addDecl('QueuedEntry');</script>; [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">A doubly-linked list entry, used as a wrapper for queued 
                cache entries. 
        
</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L361">set</a></span>
<script>explorer.outline.addDecl('set');</script>(K <span class="funcparam">key</span>, V <span class="funcparam">value</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Set this linked-list entry with the given arguments. </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L375">prepend</a></span>
<script>explorer.outline.addDecl('prepend');</script>(Ref <span class="funcparam">before</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Insert this entry into the linked-list just in 
                        front of the given entry.
        
</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L399">append</a></span>
<script>explorer.outline.addDecl('append');</script>(Ref <span class="funcparam">after</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Add this entry into the linked-list just after 
                        the given entry.
        
</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Ref <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/container/more/StackMap.d?rev=3791#L424">extract</a></span>
<script>explorer.outline.addDecl('extract');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Remove this entry from the linked-list. The 
                        previous and next entries are patched together 
                        appropriately.
        
</font><br><br></dd></dl></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2008 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:33 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>